import { reqJson } from './requestWithToken';
import domain from '@/utils/domain';

export async function usersPage(params) {
  const url = `${domain.user}/sys/users/page`;
  return reqJson.get(url, params);
}

export async function usersUpdate(params) {
  const url = `${domain.user}/sys/users/update`;
  return reqJson.postJson(url, params);
}

export async function resetPassword(params) {
  const url = `${domain.user}/sys/users/resetPassword`;
  return reqJson.postJson(url, params);
}

export async function usersRemove(params) {
  const url = `${domain.user}/sys/users/remove`;
  return reqJson.postJson(url, params);
}

export async function userRoles(params) {
  const url = `${domain.user}/sys/users/roles`;
  return reqJson.get(url, params);
}

export async function userRolesUpdate(params) {
  const url = `${domain.user}/sys/users/allot-role`;
  return reqJson.postJson(url, params);
}
